﻿using System.Collections.ObjectModel;
using System.Linq;
using System.Windows;
using MaxStoreErp.Core.BaseClasses;
using MaxStoreErp.Core.Interfaces;
using MaxStoreErp.Core.Threading;

namespace ModuleWithMenu.TestForm
{
    internal class TestFormPresenter : PresenterBase<TestFormView, TestFormViewModel>, IToolBarProvider
    {
        public ReadOnlyCollection<FrameworkElement> ToolBarItems { get; private set; }

        protected override void OnViewSet()
        {
            base.OnViewSet();
            ThreadHelper.SafeCall(() =>
            {
                ToolBarItems =
                    new ReadOnlyCollection<FrameworkElement>(View.MyToolBar.Items.Cast<FrameworkElement>().ToList());
            });
        }
    }
}
